import defineEslint from '@antfu/eslint-config'
import { FlatCompat } from '@eslint/eslintrc'

const compat = new FlatCompat()

export default defineEslint(
  {
    files: ['src', 'test', 'plugins', 'e2e'],
    stylistic: false,
    vue: {
      overrides: {
        'vue/multi-word-component-names': ['error', { ignores: ['index'] }],
        'vue/attribute-hyphenation': 'off'
      }
    },
    typescript: {
      parserOptions: {
        project: 'config/tsconfig.vitest.json',
        parser: '@typescript-eslint/parser'
      },
      overrides: {
        'no-restricted-syntax': 'off',
        'ts/consistent-type-definitions': 'off',
        'ts/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
        'ts/prefer-literal-enum-member': 'off'
      }
    }
  },
  {
    ignores: [
      'node_modules',
      'dist',
      'public',
      '*.{json,yaml,yml,md,css,scss,less,html,gitignore,editorconfig}'
    ]
  },

  ...compat.config({
    extends: ['@vue/eslint-config-prettier']
  })
)
